import { request }  from '@/common/utils';
//POST 创建游戏
  /**
   * @param {Object} gameinfo {
  "gameRoleSettings": [
    {
      "code": "bc",
      "count": 0,
      "type": "priesthood"
    },
  ],
  "playerCount": 12
}
   */ 
export const creategame = gameinfo => request.post(`/dm/game/create`,gameinfo)

//POST 查询游戏详情
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const querygamedetailbydm = gameid => request.post(`/dm/game/detail`,gameid)

//POST 结束游戏
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const endgame = gameid => request.post(`/dm/game/end`,gameid)

//POST 结束当前夜晚
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const endcurrentnight = gameid => request.post(`/dm/game/end-night`,gameid)

//POST 创建当前回合
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const createcurrentround = gameid=> request.post(`/dm/game/new-stage`,gameid)

//POST 录入玩家行为
/**
   * @param {Object} gameaction {
  "actions": [
    {
      "actionSeatNumber": 0,
      "targetSeatNumber": 0,
      "type": "campaign_police"
    }
  ],
  "code": "string"
}
   */
export const addplayeraction=gameaction => request.post(`/dm/game/stage/add-action`,gameaction)

//POST 结束投票
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const endvote = gameid => request.post(`/dm/game/stage/end-vote`,gameid)

//POST 开始投票
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const startvote =gameid=> request.post(`/dm/game/stage/start-vote`,gameid)

//POST 开始游戏
/**
   * @param {Object} gameid {
  "code": "string"
}
   */
export const startgame = gameid => request.post(`/dm/game/start`,gameid)

//POST 编辑玩家得分
/**
   * @param {Object} gamemark {
  "code": "string",
  "mark": 0,
  "markType": "basic",
  "seatNumber": 0
}
   */
export const editplayermark = gamemark => request.post(`/dm/mark/add`,gamemark)

//POST 删除玩家行为
/**
   * @param {Object} gameaction {
  "actionIds": [
    "string"
  ],
  "code": "string"
}
   */
export const delplayeraction = gameaction => request.post(`/dm/game/stage/delete-action`,gameaction)